package com.safewind.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.safewind.model.HistorySend;
import com.safewind.model.User;
import com.safewind.service.IHistorySendService;

@Controller
@RequestMapping("/historySend")
public class HistorySendController {
	@Resource
	private IHistorySendService historySendService;

	@RequestMapping("/getAll")
	@ResponseBody
	public Object getAll(HttpServletRequest request, HttpSession session) {
		Map<String, Object> map = new HashMap<String, Object>();
		User user = (User) session.getAttribute("user");
		List<HistorySend> list = historySendService.getAll(user.getPkUserId());
		map.put("list", list);
		map.put("success", true);
		return map;
	}
}
